<div id="container">
    <div class="tip warning">Please make your supervisord conf file writtable.</div>
    <div class="code">
        sudo chmod 666 /etc/supervisor/supervisord.conf
    </div>
    <table id="workers-configration">
        <caption>Below is the configration in the main.php file</caption>
        <thead>
            <tr>
                <th>Queue</th>
                <th>Amount of Workers</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($workerConfig as $queue => $amount) { ?>
                <tr>
                    <td><?php echo $queue;?></td>
                    <td><?php echo $amount;?></td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
    <div class="tip info">You can confirm the workers configuration or create customed one with the creating function below.</div>
    <form id="confirm-form" action="<?php echo Yii::app()->baseUrl . '/resque/monitor/confirm';?>" method="POST">
        <input id="request-token" name="request-token" type="hidden" value="<?php echo $requestToken;?>"/>
        <input id="confirm" type="submit" value="Confirm"/>
    </form>
    <form id="create-worker" action="<?php echo Yii::app()->baseUrl . '/resque/monitor/create';?>" method="POST">
        <fieldset>
            <legend>Create Worker</legend>
            <ul class="item-list">
                <li class="item">
                    <label for="queue">Queue Name</label>
                    <input id="queue" name="queue"/>
                </li>
                <li class="item">
                    <label for="count">Amount of Queue</label>
                    <input type="number" min="1" max="10" id="count" name="count"/>
                </li>
                <li class="item">
                    <label for="redis">Redis Backend</label>
                    http://<input id="ip", name="ip"/> : <input type="number" min="0" max="65535"  id="port" name="port"/>
                </li>
                <li class="item">
                    <label for="password">Redis Password</label>
                    <input id="password" name="password"/>
                </li>
                <li class="item">
                    <label for="redis-prefix">Redis Data Prefix</label>
                    <input id="redis-prefix" name="redis-prefix"/>
                </li>
                <li class="item">
                    <label for="interval">Interval</label>
                    <input type="number" min="0" id="interval" name="interval"/>
                </li>
                <li class="item">
                    <label for="app-include">App Include</label>
                    <input id="app-include" name="app-include"/>
                </li>
            </ul>
        <input id="request-token" name="request-token" type="hidden" value="<?php echo $requestToken;?>"/>
        <input id="create" type="submit" value="Create"/>
        </fieldset>
    </form>


    <table id="redis-data">
        <caption>Redis Data</caption>
        <thead>
            <tr>
                <th>Key</th>
                <th>Type</th>
                <th>Value</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($data as $key => $value) { ?>
            <tr>
                <td><?php echo $key;?></td>
                <td><?php echo $value['type'];?></td>
                <td><?php echo $value['value'];?></td>
            </tr>
        <?php } ?>
        </tbody>
    </table>

    <table id="redis-info">
        <caption>Redis Status</caption>
        <thead>
            <tr>
                <th>Property</th>
                <th>Value</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($info as $key => $value) { ?>
            <tr>
                <td><?php echo $key;?></td>
                <td><?php echo $value;?></td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
</div>
<div id="scroll-to-top" onclick="window.scrollTo(0, 0);">Top</div>
